package com.supplychainapi.service;

import com.joindata.inf.common.basic.exceptions.ServiceException;
import com.supplychainapi.common.RestResponse;
import com.supplychainapi.domain.MaterialListSearch;
import com.supplychainapi.domain.Tbunit;
import com.supplychainapi.domain.TbunitDto;
import com.supplychainapi.model.ScmTbunit;
import com.supplychainapi.param.ColTitle;
import com.supplychainapi.param.TbUnitParam;

import java.util.List;

/**
 * Created by wangziqi on 2017/9/26.
 */
public interface TbUnitService {

    /**
     * 新增
     * @param model
     * @return
     */
    RestResponse save(TbUnitParam model)throws ServiceException;

    /**
     * 更新
     * @param model
     * @return
     */
    RestResponse update(TbUnitParam model)throws ServiceException;

    /**
     * 批量删除
     * @param list          unid
     * @param shopGuid      店铺id
     * @return
     * @throws ServiceException
     */
    RestResponse delete(List<String> list,String shopGuid)throws ServiceException;

    /**
     * 查询所有单位该店铺
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse<List<TbunitDto>> selectAll(String shopGuid, MaterialListSearch search) throws ServiceException;


    /**
     * 查询所有单位该店铺
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse<List<TbunitDto>> selectList(String shopGuid, MaterialListSearch search) throws ServiceException;

    RestResponse<List<ScmTbunit>> selectAll(String shopGuid) throws ServiceException;


    RestResponse<List<Tbunit>> search(String shopGuid, Integer pageNum, Integer pageSize, String keyWords) throws ServiceException;


    /**
     * 查询所有单位该店铺
     * @param shopGuid
     * @return
     * @throws ServiceException
     */
    RestResponse<List<ScmTbunit>> selectActivatAll(String shopGuid) throws ServiceException;

    /**
     * 根据主键查询
     * @param shopGuid
     * @param fsUnitId
     * @return
     * @throws ServiceException
     */
    RestResponse<ScmTbunit> selectById(String shopGuid,String fsUnitId) throws ServiceException;


    /**
     * 获取最新的主键id
     * @param shopGuid
     * @return
     */
    String getCode(String shopGuid);

    List<ColTitle> getSchema();


    List<ColTitle> getSelectSchema();
}
